<template>
	<view class="record">
		<view class="no-record" v-if='useNum===0?true:false'>
			您还未进行过AI舌诊检测
		</view>
		<view class="record-message" v-else>
			<view class="record-num">
				<text class="record-num-text1">{{useNum}}次</text>
				<br />
				<text class="record-num-text2">累计检测次数</text>
			</view>
			<view class="messages" @click="goInspectionreport(item.szReportInfoId)" v-for="(item,index) in useMessage">
				<view class="visitor-up">
					<view class="visitor-imgs">
						<image class="visitor-img" :src="item.szCheckTopImgUrl"></image>
						<image class="visitor-img" :src="item.szCheckBackImgUrl"
							v-if="item.szCheckBackImgUrl===''? false:true"></image>
						<view class="visitor-quota">
							{{item.szScope}}
							<view class="visitor-symptom">
								{{item.szConstitutionName}}
							</view>
						</view>
					</view>
					<view class="visitor-days">
						<view class="visitor-day">
							{{item.szCreateTime}}
						</view>
						<view class="icon">
							<uni-icons type="right" size="16"></uni-icons>

						</view>
					</view>
				</view>



				<view class="visitor">
					<view class="visitor-content">
						<view>
							检测人
							<text> {{item.szCheckName}}</text>
						</view>
						<view>
							性别
							<text>{{item.szCheckSex}}</text>
						</view>
						<view>
							年龄
							<text>{{item.szCheckAge}}岁</text>

						</view>
					</view>
					<view class="visitor-phone" v-if="item.szCheckTel? true:false">
						联系方式
						<text>{{item.szCheckTel}}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import * as TongueApi from '@/api/tongue/tongue.js'
	export default {
		onLoad(options) {

			console.log(options.params)
			const paramsStr = options.params;
			const receivedParams = JSON.parse(paramsStr); // 将参数字符串解析为对象
			this.wxid = receivedParams.wxid
			console.log(this.wxid)
			this.getInfo()
		},
		data() {
			return {
				wxid: null,
				useNum: 0,
				useMessage: {
					id: null,
					szCheckAge: null,
					szCheckBackImgUrl: "",
					szCheckName: "",
					szCheckSex: "",
					szCheckTel: "",
					szCheckTopImgUrl: "",
					szConstitutionName: "",
					szCreateTime: "",
					szDeleteStatus: 1,
					szReportInfoId: null,
					szScope: "",
					wxUserId: null
				}
			}
		},
		methods: {
			//通过wxID 获取检测信心
			async getInfo() {
				const res = await TongueApi.getReport()
				this.useMessage = res.data.data
				console.log(this.useMessage)
				this.useNum = this.useMessage.length
			},

			//去详情报告
			goInspectionreport(e) {
				uni.$toPage('/subpkg/AIdiagnos/InspectionReport/InspectionReport', {
					reportid: e
				})
			}
		}
	}
</script>

<style lang="scss">
	.record {
		height: 100vh;
		width: 100vw;
		padding: 0;
		margin: 0;
		overflow-y: scroll;

		// height: 100vh;
		.no-record {
			display: flex;
			flex-direction: column;
			padding-top: 418rpx;
			align-items: center;
			color: rgba(102, 102, 102, 1);

		}

		.record-message {
			.record-num {
				margin-top: 15rpx;
				margin-left: 30rpx;

				.record-num-text1 {
					font-size: 48rpx;
					font-weight: 700;
					letter-spacing: 0rpx;
					line-height: 69.5rpx;
					color: rgba(0, 0, 0, 1);
				}

				.record-num-text2 {
					/** 文本3 */
					font-size: 26rpx;
					font-weight: 400;
					letter-spacing: 0rpx;
					line-height: NaNrpx;
					color: rgba(85, 85, 87, 1);
					text-align: left;
					vertical-align: top;
				}

			}

			.messages {
				margin-top: 30rpx;
				margin-left: 30rpx;
				width: 694rpx;
				opacity: 1;
				border-radius: 14rpx;

				background: rgba(255, 255, 255, 1);
				display: flex;
				flex-wrap: wrap;

				.visitor-up {
					display: flex;
					width: 100%;
					justify-content: space-between;

					.visitor-imgs {
						display: flex;

						.visitor-img {
							display: flex;
							margin-top: 20rpx;
							margin-left: 20rpx;
							margin-bottom: 20rpx;
							width: 100rpx;
							height: 100rpx;
							opacity: 1;
							border-radius: 8rpx;
						}

						.visitor-quota {

							margin-top: 15rpx;
							margin-left: 15rpx;
							font-size: 40rpx;
							font-weight: 500;
							letter-spacing: 0rpx;
							line-height: 57.92rpx;
							color: rgba(13, 209, 203, 1);
							text-align: center;
							vertical-align: top;

							.visitor-symptom {
								margin-top: 10rpx;
								margin-left: 10rpx;
								padding: 5rpx;
								height: 30rpx;
								opacity: 1;
								border-radius: 4rpx;
								background: rgba(13, 209, 203, 1);
								/** 文本1 */
								font-size: 20rpx;
								font-weight: 400;
								letter-spacing: 0rpx;
								line-height: 28.96rpx;
								color: rgba(255, 255, 255, 1);
								text-align: center;
								vertical-align: top;
							}
						}
					}

					.visitor-days {
						display: flex;
						align-items: center;
						margin-top: -80rpx;

						.visitor-day {
							font-size: 24rpx;
							font-weight: 400;
							letter-spacing: 0rpx;
							line-height: 34.76rpx;
							color: rgba(85, 85, 87, 1);
							text-align: center;
							vertical-align: top;
							margin-right: 10rpx;

						}

						.icon {
							uni-icons {
								font-weight: bold;
							}
						}
					}

				}





				.visitor {
					margin-top: 20rpx;
					width: 694rpx;
					opacity: 1;
					border-bottom-left-radius: 14rpx;
					border-bottom-right-radius: 14rpx;
					background: rgba(232, 255, 254, 1);

					.visitor-content {
						margin-top: 12rpx;
						margin-bottom: 12rpx;
						width: 600rpx;
						margin-left: 20rpx;
						display: flex;
						justify-content: space-between;
						opacity: 1;
						/** 文本1 */
						font-size: 28rpx;
						font-weight: 400;
						letter-spacing: 0rpx;
						line-height: 40.54rpx;
						color: rgba(85, 85, 87, 1);

						text {
							/** 文本2 */
							margin-left: 20rpx;
							font-size: 28rpx;
							font-weight: 400;
							letter-spacing: 0rpx;
							line-height: NaNrpx;
							color: rgba(0, 0, 0, 1);
							text-align: left;
							vertical-align: top;
						}
					}

					.visitor-phone {
						margin-top: 5rpx;
						margin-left: 20rpx;
						/** 文本1 */
						font-size: 28rpx;
						font-weight: 400;
						letter-spacing: 0rpx;
						line-height: 40.54rpx;
						color: rgba(85, 85, 87, 1);

						text {
							/** 文本2 */
							margin-left: 20rpx;
							font-size: 28rpx;
							font-weight: 400;
							letter-spacing: 0rpx;
							line-height: NaNrpx;
							color: rgba(0, 0, 0, 1);
							text-align: left;
							vertical-align: top;
						}
					}

				}
			}

		}
	}

	.record::-webkit-scrollbar {
		display: none;

	}
</style>